<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<script>
			var array_test = {
				sort: function(a, b) {
					if(a < b) {
						return -1;
					}
					if(a > b) {
						return 1;
					}
					return 0;
				},
				test:function() {
					var arr = [10, 5, 1, 2];
					arr = arr.sort(this.sort);
					alert(arr.toString());
					return arr;
				}
 
			}

			alert(array_test.test());
			/*Array.prototype.equals = function(array) {
				if(!array)
					return false;
				if(this.length != array.length)
					return false;
				for(var i = 0, l = this.length; i < l; i++) {
					if(this[i] instanceof Array && array[i] instanceof Array) {
						if(!this[i].equals(array[i]))
							return false;
					} else if(this[i] != array[i]) {
						return false;
					}
				}
				return true;
			}*/

		</script>
	</body>

</html>